package entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * 用户实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "UserEntity", description = "用户实体类")
public class UserEntity {

    @ApiModelProperty(hidden = true)
    private String id;

    @ApiModelProperty(example = "2")
    private String roleId;

    @ApiModelProperty(example = "admin")
    private String roleSign; //  角色标志 例如：admin editor

    @ApiModelProperty(example = "铁蛋儿")
    private String roleName; //  角色中文名

    @NotEmpty(message = "用户名不能为空")
    @Size(min = 5,max = 10,message = "长度在 5 到 20 个字符")
    private String userName;

    @Size(min = 5,max = 1000,message = "密码长度必须超过 5 个字符")
    @ApiModelProperty(hidden = true)
    private String password;

    @ApiModelProperty(name = "headPic",value = "头像",example = "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
    private String headPic;

    @Size(min = 1,max = 10,message = "昵称长度必须在1到10之间")
    @ApiModelProperty(example = "小王")
    private String nickName;

    @Size(min = 1,max = 6,message = "真实姓名长度必须在1到6之间")
    @ApiModelProperty(example = "王建国")
    private String realName;

    @Max(value = 150,message = "年龄只能是1到150岁")
    @Min(value = 1,message = "年龄只能是1到150岁")
    @ApiModelProperty(example = "18")
    private Integer age;

    @Max(value = 1,message = "性别参数只能是 1 和 0")
    @Min(value = 0,message = "性别参数只能是 1 和 0")
    private Integer gender;

    @Past(message = "生日不能是未来的时间")
    private Date birth;

    @ApiModelProperty(example = "没有个性哪来的签名。。。")
    private String comment; // 个性签名

    @ApiModelProperty(hidden = true)
    private Date createTime;

    @ApiModelProperty(hidden = true)
    private String createUserId;

    @ApiModelProperty(hidden = true)
    private Date updateTime;

    @ApiModelProperty(hidden = true)
    private String updateUserId;

    @ApiModelProperty(name = "isDeleted", value = "是否被删除 0有效 1无效")
    private Integer isDeleted;

}
